
package todolist.personalization;

/**
 * Controls application behaviour related to Task Field input, for edit and sort purposes, as well as display.
 * Singleton class.
 * Currently allows getting only, may allow reading/setting/writing in the future.
 * @author Ivan
 */
public class TaskFieldCustomizer {
	
	// handle singleton instance

	private static TaskFieldCustomizer _objTFC;

	public static TaskFieldCustomizer getInstance() {
		if (_objTFC == null)
			_objTFC = new TaskFieldCustomizer();
		return _objTFC;
	}

	// input Task Field Type

	private static final String FIELD_INPUT_DELIMITER = "||";
	private static final String[] FIELD_INPUT_TASKNAME = {
		"tasknames", "names", "descriptions"};
	private static final String[] FIELD_INPUT_DT = {
		"datetimes", "times", "duedates", "enddates", "dts"};
	private static final String[] FIELD_INPUT_PRIORITY = {
		"prioritytypes", "urgency", "urgent", "important", "importance", "impt"};
	private static final String[] FIELD_INPUT_TASKCOMMENTS = {
		"comments", "others", "miscellaneous"};
	private static final String[] FIELD_INPUT_REMINDER = {
		"reminders", "offsets", "alarms", "notifications", "notify"};
	private static final String[] FIELD_INPUT_STATUS = {
		"statuses", "progress"};
	
	// input Sort Direction Type
	
	private static final String[] SORT_INPUT_ASC = {
		"ascending", "upwards", "lowest", "smallest", "least", "less", ">>"};
	private static final String[] SORT_INPUT_DESC = {
		"descending", "dsc", "downwards", "highest", "biggest", "largest", "greatest", "more", "<<"};
	
	// display Task Field Type

	private static final String FIELD_DISPLAY_DELIMITER = ":";
	private static final String FIELD_DISPLAY_TASKID = "Task ID";
	private static final String FIELD_DISPLAY_TASKNAME = "Task Name";
	private static final String FIELD_DISPLAY_DT = "Date/Time";
	private static final String FIELD_DISPLAY_PRIORITY = "Priority";
	private static final String FIELD_DISPLAY_TASKCOMMENTS = "Comments";
	private static final String FIELD_DISPLAY_REMINDER = "Reminder Offset";
	private static final String FIELD_DISPLAY_STATUS = "Status";
	
	// input Task Field Type
	
	/**
	 * Delimiter between data fields.
	 */
	public String getInputFieldDelimiter() {
		return FIELD_INPUT_DELIMITER;
	}
	
	/**
	 * Returns all keywords for Task Name field.
	 */
	public String[] getInputFieldTaskName() {
		return FIELD_INPUT_TASKNAME;
	}
	
	/**
	 * Returns all keywords for DT field.
	 */
	public String[] getInputFieldDT() {
		return FIELD_INPUT_DT;
	}
	
	/**
	 * Returns all keywords for Priority field.
	 */
	public String[] getInputFieldPriority() {
		return FIELD_INPUT_PRIORITY;
	}
	
	/**
	 * Returns all keywords for Task Comments field.
	 */
	public String[] getInputFieldTaskComments() {
		return FIELD_INPUT_TASKCOMMENTS;
	}
	
	/**
	 * Returns all keywords for Reminder Offset field.
	 */
	public String[] getInputFieldReminder() {
		return FIELD_INPUT_REMINDER;
	}
	
	/**
	 * Returns all keywords for Task Status field.
	 */
	public String[] getInputFieldStatus() {
		return FIELD_INPUT_STATUS;
	}
	
	// input Sort Direction Type

	/**
	 * Returns all keywords to describe ascending Sort.
	 */
	public String[] getInputSortAscending() {
		return SORT_INPUT_ASC;
	}
	
	/**
	 * Returns all keywords to describe descending Sort.
	 */
	public String[] getInputSortDescending() {
		return SORT_INPUT_DESC;
	}
	
	// display Task Field Type
	
	/**
	 * Delimiter between data fields.
	 */
	public String getDisplayFieldDelimiter() {
		return FIELD_DISPLAY_DELIMITER;
	}

	/**
	 * Field descriptor for Task ID.
	 */
	public String getDisplayFieldTaskID() {
		return FIELD_DISPLAY_TASKID;
	}
	
	/**
	 * Field descriptor for Task Name.
	 */
	public String getDisplayFieldTaskName() {
		return FIELD_DISPLAY_TASKNAME;
	}
	
	/**
	 * Field descriptor for Date/Time.
	 */
	public String getDisplayFieldDT() {
		return FIELD_DISPLAY_DT;
	}
	
	/**
	 * Field descriptor for Priority.
	 */
	public String getDisplayFieldPriority() {
		return FIELD_DISPLAY_PRIORITY;
	}
	
	/**
	 * Field descriptor for Task Comments.
	 */
	public String getDisplayFieldTaskComments() {
		return FIELD_DISPLAY_TASKCOMMENTS;
	}
	
	/**
	 * Field descriptor for Reminder Offset.
	 */
	public String getDisplayFieldReminder() {
		return FIELD_DISPLAY_REMINDER;
	}
	
	/**
	 * Field descriptor for Task Status.
	 */
	public String getDisplayFieldStatus() {
		return FIELD_DISPLAY_STATUS;
	}
	
}
